<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg">
      <div class="banner-info">
        <div class="banner-title">
          {{this.sightName}}
        </div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe692;</span>
          {{this.bannerImgs.length}}
        </div>
      </div>
    </div>
    <FadeAnimation>
      <CommonGallary
        :imgs="bannerImgs"
        v-show="showGallary"
        @close="handleGallaryClose"
      ></CommonGallary>
    </FadeAnimation>
  </div>
</template>

<script>
  import CommonGallary from 'common/gallary/Gallary'
  import FadeAnimation from 'common/fade/FadeAnimation'

  export default {
    props: {
      sightName: String,
      bannerImg: String,
      bannerImgs: Array
    },
    data() {
      return {
        showGallary: false
      }
    },
    components: {CommonGallary, FadeAnimation},
    methods: {
      handleBannerClick() {
        this.showGallary = true
      },
      handleGallaryClose() {
        this.showGallary = false
      }
    },
    watch: {},
    mounted() {

    }
  }
</script>
<style scoped lang="stylus" type="text/stylus">
  .banner
    position relative
    padding-bottom 55%
    height 0
    overflow hidden
    .banner-img
      width 100%
    .banner-info
      display flex
      position absolute
      right 0
      bottom 0
      left 0
      color #fff
      line-height .6rem
      background linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .8))
      .banner-title
        font-size .32rem
        padding 0 .2rem
        flex 1
      .banner-number
        margin-top .14rem
        background rgba(0, 0, 0, .8)
        border-radius .2rem
        height .32rem
        line-height .32rem
        font-size .24rem
        padding 0 .4rem
      .banner-icon
        font-size .24rem
</style>
